<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
	<title>企业管理系统</title>

	<!-- Bootstrap -->
	<link href="${pageContext.request.contextPath}/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
	<link href="${pageContext.request.contextPath}/css/list.css" rel="stylesheet">
	<link href="${pageContext.request.contextPath}/css/detail.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid clear">
	<div class="nav-menu">
		<div class="nav navbar-nav navbar-left">
			<a href="">
				企业管理系统
			</a>
		</div>
		<div class="nav navbar-nav navbar-right">
			<li class="dropdown">
				<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
					${empty sessionScope.user.nickName ? '用户昵称未设置' : sessionScope.user.nickName }
					<span class="caret"></span></a>
				<ul class="dropdown-menu">
					<li><a href="../users/setting.jsp">设置</a></li>
					<li role="separator" class="divider"></li>
					<li><a href="logout">退出</a></li>
				</ul>
			</li>
		</div>
		<div class="clear"></div>
	</div>
	<div class="back-box">
		<a href="${pageContext.request.contextPath}/staffs?type=list" class="back-btn  btn-default btn-lg">&lt;&nbsp;返&nbsp;&nbsp;回</a>
	</div>
	<div class="container content-box">
		<div class="row detail-title">
			<c:choose>
				<c:when test="${param.type eq 'view'}">
                    <span>
                       <span>${requestScope.DATA.name}</span>
                        员工详情查看
                    </span>
				</c:when>
				<c:when test="${param.type eq 'edit'}">
                    <span>
                       <span>${requestScope.DATA.name}</span>
                        员工信息修改
                    </span>
				</c:when>
				<c:otherwise>
                    <span>
                       添加员工
                    </span>
				</c:otherwise>
			</c:choose>
		</div>
		<div class="row">
			<div class="detail-box">
				<form class="form-horizontal" method="post" action="${pageContext.request.contextPath}/staffs?type=${param.type}">
					<div class="form-group hidden">
						<label for="staff_id" class="col-sm-offset-2 col-sm-2 control-label">员工主键</label>
						<div class="col-sm-4">
							<input type="text" class="form-control input-lg" id="staff_id" readonly name="id" value="${requestScope.DATA.id}">
						</div>
					</div>
					<div class="form-group">
						<label for="staff-code" class="col-sm-offset-2 col-sm-2 control-label">用工编号</label>
						<div class="col-sm-4">
							<input type="text" class="form-control input-lg" id="staff-code" placeholder="请输入员工编号" name="code"
							${param.type eq 'view' ? 'readonly' : '' } value="${requestScope.DATA.code}">
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-name" class="col-sm-offset-2 col-sm-2 control-label">员工姓名</label>
						<div class="col-sm-4">
							<input type="text" class="form-control input-lg" id="input-staff-name" name="name" value="${requestScope.DATA.name}"
							${param.type eq 'view' ? 'readonly' : '' } placeholder="请输入员工姓名">
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-dept-id" class="col-sm-offset-2 col-sm-2 control-label">所属部门</label>
						<div class="col-sm-4">
							<%--                            <select class="form-control input-lg"  name="dong">--%>
							<%--<!--                            <c:forEach var="i" begin="1" end="30" >-->--%>
							<%--                                <option value="${i}" >${i}</option>--%>
							<%--<!--                            </c:forEach>-->--%>
							<%--                            </select>--%>
							<input id="input-staff-dept-id" class="form-control input-lg" type="text" ${param.type eq 'view' ? 'readonly' : '' } name="dept_id" value="${requestScope.DATA.deptId}">
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-idCard" class="col-sm-offset-2 col-sm-2 control-label">身份证号</label>
						<div class="col-sm-4">
							<input type="text" class="form-control input-lg" id="input-staff-idCard" name="id_card" value="${requestScope.DATA.idCard}"
							       ${param.type eq 'view' ? 'readonly' : '' } placeholder="请输入身份证号">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-offset-2 col-sm-2 control-label">性别</label>
						<div class="col-sm-4">
							<label class="radio-inline">
								<input type="radio" name="gender" ${param.type eq 'view' ? 'disabled' : '' } ${requestScope.DATA.gender eq 1 ? 'checked' : ''}
								       value="1"> 男
							</label>
							<label class="radio-inline">
								<input type="radio" name="gender" ${param.type eq 'view' ? 'disabled' : '' } ${requestScope.DATA.gender eq 2 ? 'checked' : ''}
								       value="2"> 女
							</label>
							<label class="radio-inline">
								<input type="radio" name="gender" ${param.type eq 'view' ? 'disabled' : '' } ${requestScope.DATA.gender eq 3 ? 'checked' : ''}
								       value="3"> 其它
							</label>
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-birthDate" class="col-sm-offset-2 col-sm-2 control-label">出生日期</label>
						<div class="col-sm-4">
							<input type="datetime-local" class="form-control input-lg" id="input-staff-birthDate" placeholder="请选择出生日期"
							${param.type eq 'view' ? 'readonly' : '' } name="birth_date" value="${requestScope.DATA.birthDate}">
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-age" class="col-sm-offset-2 col-sm-2 control-label">年龄</label>
						<div class="col-sm-4">
							<input id="input-staff-age" class="form-control input-lg" type="number" min="20" max="100" name="age" value="${requestScope.DATA.age}"
							${param.type eq 'view' ? 'readonly' : '' }
							>
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-nation" class="col-sm-offset-2 col-sm-2 control-label">民族</label>
						<div class="col-sm-4">
							<select id="input-staff-nation" class="form-control input-lg" name="nation" ${param.type eq 'view' ? 'disabled' : '' } >
								<c:forEach var="item" items="${applicationScope.STATICDTATD.NATIONS}" varStatus="STATUS">
									<option value="${STATUS.index}" ${requestScope.DATA.nation eq STATUS.index ? 'selected' : ''}>${STATUS.count}.${item}</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-politicalStatus" class="col-sm-offset-2 col-sm-2 control-label">政治面貌</label>
						<div class="col-sm-4">
							<select id="input-staff-politicalStatus" class="form-control input-lg"
							        name="political_status" ${param.type eq 'view' ? 'disabled' : '' } >
								<c:forEach var="item" items="${applicationScope.STATICDTATD.POLITICAL_STATUS}" varStatus="STATUS">
									<option value="${STATUS.index}" ${requestScope.DATA.politicalStatus eq STATUS.index ? 'selected' : ''}>${STATUS.count}.${item}</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-maritalStatus" class="col-sm-offset-2 col-sm-2 control-label">婚姻状况</label>
						<div class="col-sm-4">
							<select id="input-staff-maritalStatus" class="form-control input-lg"
							        name="marital_status" ${param.type eq 'view' ? 'disabled' : '' } >
								<c:forEach var="item" items="${applicationScope.STATICDTATD.MARITAL_STATUS}" varStatus="STATUS">
									<option value="${STATUS.index}" ${requestScope.DATA.maritalStatus eq STATUS.index ? 'selected' : ''}>${STATUS.count}.${item}</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-educationLevel" class="col-sm-offset-2 col-sm-2 control-label">文化程度</label>
						<div class="col-sm-4">
							<select id="input-staff-educationLevel" class="form-control input-lg"
							        name="education_level" ${param.type eq 'view' ? 'disabled' : '' } >
								<c:forEach var="item" items="${applicationScope.STATICDTATD.EDUCATION_LEVEL}" varStatus="STATUS">
									<option value="${STATUS.index}" ${requestScope.DATA.educationLevel eq STATUS.index ? 'selected' : ''}>${STATUS.count}.${item}</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="input-staff-tel" class="col-sm-offset-2 col-sm-2 control-label">联系电话</label>
						<div class="col-sm-4">
							<input type="tel" class="form-control input-lg" id="input-staff-tel" placeholder="请输入联系电话"
							 name="tel" value="${requestScope.DATA.tel}" ${param.type eq 'view' ? 'readonly' : '' }>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-offset-2 col-sm-2 control-label">创建时间</label>
						<div class="col-sm-4">
								<input type="datetime-local" class="form-control input-lg" disabled value="${requestScope.DATA.createdTime}">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-offset-2 col-sm-2 control-label">最近修改时间</label>
						<div class="col-sm-4">
								<input type="datetime-local" class="form-control input-lg" disabled value="${requestScope.DATA.updateTime}">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-offset-2 col-sm-2 control-label">账户状态</label>
						<div class="col-sm-4">
							<label class="radio-inline">
								<input type="radio" name="disable" ${param.type eq 'view' ? 'disabled' : '' } ${requestScope.DATA.disable  ? 'checked' : ''}
								       value="1"> 停用
							</label>
							<label class="radio-inline">
								<input type="radio" name="disable" ${param.type eq 'view' ? 'disabled' : '' } ${requestScope.DATA.disable  ? '' : 'checked' }
								       value="0"> 正常
							</label>
						</div>
					</div>
					<div class="form-group ${param.type ne 'view' ? '' : 'hidden'}">
						<div class="col-sm-offset-3 col-sm-6">
							<button type="submit" class="btn btn-info btn-lg">提交并保存</button>
						</div>
					</div>
				</form>

			</div>
		</div>
	</div>
</div>
</body>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="${pageContext.request.contextPath}/jQuery/jquery-3.5.1.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="${pageContext.request.contextPath}/bootstrap-3.3.7/js/bootstrap.min.js"></script>
</html>